<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

Route::get('/', function () {
    return view('welcome');
});

Auth::routes();

Route::get('/home', 'HomeController@index')->name('home');
Route::get('/lazyindex', 'HomeController@lazyIndex');

Route::post('/home/gnotification', 'HomeController@globalNotification');

Route::group(['middleware' => 'auth', 'namespace' => 'Admin', 'prefix' => 'admin'], function() {
    Route::get('/', 'HomeController@index');

    Route::get('/article', 'ArticleController@index');
    Route::resource('article', 'ArticleController');

    Route::get('/comment', 'CommentController@index');
    Route::resource('comment', 'CommentController');

    Route::get('/user', 'UserController@index');
    Route::resource('user', 'UserController');

    Route::get('/category', 'CategoryController@index');
    Route::resource('category', 'CategoryController');

    Route::get('/paper', 'PaperController@index');
    Route::get('/paper/review', 'PaperController@review');
    Route::get('/paper/reset_review', 'PaperController@resetReview');
    Route::resource('paper', 'PaperController');
});



Route::get('/notification', 'NotificationController@index');

Route::get('paper/{id}/upvote', 'PaperController@upvote');
Route::get('paper/userpaper', 'PaperController@userPaper');
Route::resource('paper', 'PaperController');

Route::get('article/readpage', 'ArticleController@readPage');
Route::get('article/upvotepage', 'ArticleController@upvotePage');
Route::resource('article', 'ArticleController');

Route::get('category/follow', 'CategoryController@follow');
Route::get('category/unfollow', 'CategoryController@unFollow');
Route::get('category/home', 'CategoryController@homeCategory');
Route::get('category/user', 'CategoryController@userCategory');
Route::resource('category', 'CategoryController');

Route::get('setting', 'UserController@home');
Route::get('setting/avatar', 'UserController@avatar');
Route::get('setting/profile', 'UserController@profile');
Route::post('setting/avatarup', 'UserController@avatarUp');

Route::get('article/{id}/upvote', 'ArticleController@upvote');
Route::post('comment', 'CommentController@store');



